package com.etc.controller;

import com.etc.entity.Counter;
import com.etc.entity.Role;

public class CounterController {

	//查找此role是否是counter中的索引值
	public int findRoleIndexInCounter(Counter counter, Role role) {
		int index = -1;
		for(int i=0; i<counter.getRoles().size(); i++) {
			if(counter.getRoles().get(i).equals(role)) {
				index = i;
			}
		}
		return index;
	}
}
